import { BaseCommand } from '../types/common.interface';
import { Config } from '../cors/config';
import { RenderTrigger } from '../cors/render-trigger';

export class ScaleCommand extends BaseCommand {
    protected pastScale = 1;
    constructor(protected conf: Config, protected render: RenderTrigger, protected scale: number) {
        super();
    }
    public execute() {
        this.pastScale = this.conf.scale;
        this.conf.updateScale(this.scale);
        this.render.triggerRenderAll();
        return true;
    }
    public redo() {
        this.conf.updateScale(this.pastScale);
        this.render.triggerRenderAll();
        return true;
    }
}